import request from "@/utils/request";

export function create(data) {
  return request({
    url: "api/v1/ExperimentTemplate/Create",
    method: "post",
    timeout: 1000000,
    data,
  });
}

export function deleteRecord(data) {
  return request({
    url: "api/v1/ExperimentTemplate/Delete",
    method: "delete",
    data,
  });
}

export function update(data) {
  debugger
  return request({
    url: "api/v1/ExperimentTemplate/Update",
    method: "post",
    timeout: 1000000,
    data,
  });
}

export function updateTemplate(data) {
  return request({
    url: "api/v1/ExperimentTemplate/UpdateTemplateContent",
    method: "post",
    timeout: 1000000,
    data,
  });
}

export function getSingleList(data) {
  return request({
    url: "api/v1/ExperimentTemplate/Get",
    method: "get",
    timeout: 800000,
    params: data,
  });
}

export function getList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "api/v2/ExperimentTemplate/GetList",
    method: "get",
    params: data,
  });
}
